<template>
	<view>
		<view class="member">
			<view class="title">
				会员
			</view>
			<view class="list">
				<view class="item" v-for="(item,index) in cardsData" :key="index" @click="goToMemberCardDetail(item.id)">
					<view class="member-title">{{item.title}}</view>
					<block v-if="item.member_price > 0">
						<view class="member-price">￥ {{item.member_price}}</view>
					</block>
					<block v-else>
						<view class="member-price">￥ 免费</view>
					</block>
					<view class="active">
						<uni-icons type="arrowright" size="14" color="#999999"></uni-icons> 
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'SupportMemberCards',
		props:{
			cardsData: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				
			}
		},
		created() {
			//console.log(this.cardsData)
		},
		methods: {
			goToMemberCardDetail: function(id){
				let urlParams = 'id='+id
				let url = '../member/detail?' + urlParams
				//指定跳转地址
				uni.navigateTo({
				    url: url
				});
			},
		}
	}
</script>

<style lang="scss">
	.member {
		background-color: #fff;
		display: flex;
		margin-bottom: 20rpx;
		padding: 20rpx;
		.title {
			color: #000;
			width: 120rpx;
			font-size: 28rpx;
			font-weight: 600;
			margin-bottom: 16rpx;
		}
		.list {
			flex: 1;
			
			.item {
				display: flex;
				.member-title {
					flex: 1;
					font-size: 24rpx;
					color: #666;
				}
				.member-price {
					flex: 1;
					font-size: 24rpx;
					color: red;
				}
				.active {
					width: 40rpx;
					text-align: center;
				}
			}
		}
	}
</style>
